package com.frinder.official.runner;

import akka.actor.ActorRef;
import com.frinder.official.spring.Actors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * Created by frinder on 2017/9/13.
 */
@Component
public class HotSwapRunner implements CommandLineRunner {

    @Autowired
    private Actors actors;

    @Override
    public void run(String... strings) throws Exception {
        ActorRef target = actors.getActorRef("hotSwapActor", "HotSwapActor");
        target.tell("foo", ActorRef.noSender());
    }

}
